import request from '@/utils/request'

// 菜单list
export function getMenuLists (params) {
  return request({
    url: '/admin/sys/permission/menu/findList',
    method: 'get',
    params
  })
}
// 菜单详情
export function getMenuInfo (params) {
  return request({
    url: `/admin/sys/permission/menu/info/${params}`,
    method: 'get'
  })
}
// 菜单(绝色)-修改时-获取上级菜单
export function parentMenuList (params) {
  return request({
    url: `/admin/sys/permission/menu/select`,
    method: 'get'
  })
}
// 菜单-新增
export function createMenuList (data) {
  return request({
    url: `/admin/sys/permission/menu/save`,
    method: 'post',
    data
  })
}
// 菜单-修改
export function updateMenuList (data) {
  return request({
    url: `/admin/sys/permission/menu/update`,
    method: 'post',
    data
  })
}
// 菜单-删除
export function deleteMenuList (params) {
  return request({
    url: `/admin/sys/permission/menu/delete/${params}`,
    method: 'post'
  })
}

// ----------------------------------------------------------------->

// 角色-查询LIst
export function getRoleList (params) {
  return request({
    url: '/admin/sys/permission/role/findPage',
    method: 'get',
    params
  })
}
// 角色新增时-获取所有部门树
export function selectSysDept (params) {
  return request({
    url: '/admin/sys/permission/dept/select',
    method: 'get',
    params
  })
}
// 角色-查询角色详情
export function getRoleInfo (params) {
  return request({
    url: `/admin/sys/permission/role/info/${params}`,
    method: 'get'
  })
}
// 角色-新增
export function createRoleList (data) {
  return request({
    url: `/admin/sys/permission/role/save`,
    method: 'post',
    data
  })
}
// 角色-修改
export function updateRoleList (data) {
  return request({
    url: `/admin/sys/permission/role/update`,
    method: 'post',
    data
  })
}
// 角色-删除
export function deleteRoleList (data) {
  return request({
    url: `/admin/sys/permission/role/delete`,
    method: 'post',
    data
  })
}

// ----------------------------------------------------------------->

// 用户管理-查询LIst
export function getUserList (params) {
  return request({
    url: '/admin/sys/permission/user/findPage',
    method: 'get',
    params
  })
}
// 用户管理-删除
export function deleteUserList (data) {
  return request({
    url: `/admin/sys/permission/user/delete`,
    method: 'post',
    data
  })
}
// 用户管理-修改时-获取所有角色
export function selectRoleList (params) {
  return request({
    url: `/admin/sys/permission/role/findList`,
    method: 'get'
  })
}
// 用户管理-查询用户详情
export function getOtherUserInfo (params) {
  return request({
    url: `/admin/sys/permission/user/info/${params}`,
    method: 'get'
  })
}
// 角色-新增
export function createUserList (data) {
  return request({
    url: `/admin/sys/permission/user/save`,
    method: 'post',
    data
  })
}
// 角色-修改
export function updateUserList (data) {
  return request({
    url: `/admin/sys/permission/user/update`,
    method: 'post',
    data
  })
}
// ----------------------------------------------------------------->

// 部门管理-查询LIst
export function getDeptList (params) {
  return request({
    url: '/admin/sys/permission/dept/findPage',
    method: 'get',
    params
  })
}
// 部门管理-删除
export function deleteDeptList (params) {
  return request({
    url: `/admin/sys/permission/dept/delete/${params}`,
    method: 'get'
  })
}
// 部门管理-新增
export function createDeptList (data) {
  return request({
    url: `/admin/sys/permission/dept/save`,
    method: 'post',
    data
  })
}
// 部门管理-修改
export function updateDeptList (data) {
  return request({
    url: `/admin/sys/permission/dept/update`,
    method: 'post',
    data
  })
}

// ----------------------------------------------------------------->

// 字典管理-查询list
export function getDictionaryList (params) {
  return request({
    url: '/sys/dictType/list',
    method: 'get',
    params
  })
}
// 字典管理-删除
export function deleteDictionaryList (data) {
  return request({
    url: `/sys/dictType/delete`,
    method: 'post',
    data
  })
}
// 字典管理-修改时候 查询字典详情
export function getDictionaryInfo (params) {
  return request({
    url: `/sys/dictType/info/${params}`,
    method: 'get'
  })
}
// 部门管理-新增
export function createDictionaryList (data) {
  return request({
    url: `/sys/dictType/save`,
    method: 'post',
    data
  })
}
// 部门管理-修改
export function updateDictionaryList (data) {
  return request({
    url: `/sys/dictType/update`,
    method: 'post',
    data
  })
}

// ----------------------------------------------------------------->

// 系统日志-查询list
export function getLogList (params) {
  return request({
    url: '/sys/log/list',
    method: 'get',
    params
  })
}

// ----------------------------------------------------------------->

// 参数管理-查询list
export function getConfigList (params) {
  return request({
    url: '/sys/config/list',
    method: 'get',
    params
  })
}
// 参数管理-删除
export function deleteConfigList (data) {
  return request({
    url: `/sys/config/delete`,
    method: 'post',
    data
  })
}
// 参数管理-新增
export function saveConfigInfo (data) {
  return request({
    url: `/sys/config/save`,
    method: 'post',
    data
  })
}
// 参数管理-修改
export function updateConfigInfo (data) {
  return request({
    url: `/sys/config/update`,
    method: 'post',
    data
  })
}

// ----------------------------------------------------------------->

// 定时任务-查询list
export function getScheduleList (params) {
  return request({
    url: '/admin/sys/schedule/job/findPage',
    method: 'get',
    params
  })
}
// 定时任务-删除
export function deleteScheduleList (data) {
  return request({
    url: `/admin/sys/schedule/job/delete`,
    method: 'post',
    data
  })
}
// 定时任务-修改时候 查询字典详情
export function getScheduleLogInfoById (params) {
  return request({
    url: `admin/sys/schedule/job/info/${params}`,
    method: 'get'
  })
}
// 定时任务-新增
export function createSchedule (data) {
  return request({
    url: `admin/sys/schedule/job/save`,
    method: 'post',
    data
  })
}
// 定时任务-修改
export function updateSchedule (data) {
  return request({
    url: `/admin/sys/schedule/job/update`,
    method: 'post',
    data
  })
}
// 定时任务-暂停
export function pauseScheduleList (data) {
  return request({
    url: `/admin/sys/schedule/job/pause`,
    method: 'post',
    data
  })
}
// 定时任务-恢复
export function resumeScheduleList (data) {
  return request({
    url: `/admin/sys/schedule/job/resume`,
    method: 'post',
    data
  })
}
// 定时任务-立即执行
export function runScheduleList (data) {
  return request({
    url: `/admin/sys/schedule/job/run`,
    method: 'post',
    data
  })
}
